package main;

import java.io.Serializable;

/**
 * Review
 * 
 * Cris added serializable and edited
 * Holly changed my_author_id from int to String 11/21
 * 
 * @author Daniel Anderson
 * @version 12/3
 */
public class Review implements Serializable{
	
	/**
	 * Generated serial version UID
	 */
	private static final long serialVersionUID = -5577946656374121002L;

	private String my_title;
	private String my_author;
	private String my_author_id;
	private String my_text;
	
	/**
	 * Default Constructor
	 */
	public Review() {
		my_title = "Default_Title";
		my_author = "Default_Author";
		my_author_id = "-1";
		//for now, default my_file is using a .java URI, we should replace this with some sort of default txt.
		my_text = "default";
	}//end of constructor1
	
	/**
	 * Primary Constructor
	 */
	public Review(String the_title, String the_author, String the_id, String the_text) {
		my_title = the_title;
		my_author = the_author;
		my_author_id = the_id;
		my_text = the_text;
	}//end of constructor2
	
	/**
	 * @return The title of the review
	 */
	public String getTitle() {
		return my_title;
	}//end of getTitle
	
	/**
	 * @return The name of the author
	 */
	public String getAuthor() {
		return my_author;
	}//end of getAuthor
	
	/**
	 * @return The unique ID of the author
	 */
	public String getAuthorID() {
		return my_author_id;
	}//end of getAuthorID
	
	/**
	 * @return The text of the review
	 */
	public String getText() {
		return my_text;
	}//end of getText
	
	/**
	 * Checks if the passed object is equal
	 * This was copied over from Manuscript by Daniel.
	 * 
	 * @author Cristopher
	 * 
	 * Precondition: the object passed in is a review
	 */
	public boolean equals(Object the_obj) {
		Review passed = (Review)the_obj;
		return (passed.my_author_id.equals(my_author_id))&&
				(passed.getTitle().equals(my_title));
	}
}//end of Review